package com.telecomyt.jwportal.activity.rich;

import android.content.Context;
import android.content.Intent;
import android.graphics.Color;

import com.telecomyt.jwportal.R;
import com.telecomyt.jwportal.base.BaseActivity;
import com.telecomyt.jwportal.base.BasePresenter;
import com.telecomyt.jwportal.utils.ToastUtils;

import butterknife.BindView;
import jp.wasabeef.richeditor.RichEditor;

/**
 * @date: 2020/9/3
 * @author: chengDa
 * @description: 富文本
 */
public class RichTextActivity extends BaseActivity {

    @BindView(R.id.mRichEditor)
    RichEditor mRichEditor;
//    @BindView(R.id.mVoiceAnimView)
//    VoiceAnimView mVoiceAnimView;

    public static void start(Context context) {
        Intent starter = new Intent(context, RichTextActivity.class);
        context.startActivity(starter);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_rich_text;
    }

    @Override
    protected void initView() {
        mRichEditor.setEditorHeight(200);
//        mRichEditor.setEditorFontSize(22);
        mRichEditor.setEditorFontColor(Color.RED);
//        mRichEditor.setEditorBackgroundColor(Color.BLUE);
//        mRichEditor.setBackgroundColor(Color.BLUE);
//        mRichEditor.setBackgroundResource(R.drawable.bg);
//        mRichEditor.setBackground("https://raw.githubusercontent.com/wasabeef/art/master/chip.jpg");
        mRichEditor.setPadding(10, 10, 10, 10);
//        mRichEditor.setPlaceholder("Insert text here...");
//        mRichEditor.setBold();//粗体
//        mRichEditor.setItalic();//斜体
        mRichEditor.setHtml("你好");
        mRichEditor.setOnTextChangeListener(new RichEditor.OnTextChangeListener() {

            @Override
            public void onTextChange(String text) {
                ToastUtils.showShort(text);

            }
        });
    }

    @Override
    protected void initData() {

    }

    @Override
    protected BasePresenter creatPresenter() {
        return null;
    }


}